<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/css/common.css?v=<?php echo(Yii::app()->params['app']['version'])?>" rel="stylesheet" type="text/css" />
<link href="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/css/page.css?v=<?php echo(Yii::app()->params['app']['version'])?>" rel="stylesheet" type="text/css" />
<script type="text/javascript">document.domain=window.location.host;</script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/jquery.js?v=<?php echo(Yii::app()->params['app']['version'])?>"></script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/util.js?v=<?php echo(Yii::app()->params['app']['version'])?>"></script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/jquery.LoadImage.js?v=<?php echo(Yii::app()->params['app']['version'])?>"></script>
</head>

<body>

<div class="top-handle">
    <div class="con" id="js_page_op_menu">
                    <div class="btn-wrap">
                <a href="javascript:;" class="btn btn-disabled" menu="restore">还原</a>
                <a href="javascript:;" class="btn btn-disabled" menu="delete_rb">删除</a>
            </div>
            <a href="javascript:;" class="button btn-gray btn-disabled" menu="clear">清空回收站</a>

                
        
        
        <div class="search-box">
            <form id="js_search_file_form">
            <label for="js_search_input">搜索文件</label>
            <input type="text" class="text" name="search_value" autocomplete="off" value="" id="js_search_input">
            <button type="submit"><i>搜索</i></button>
            </form>
            <script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/search_file.js?v=<?php echo(Yii::app()->params['app']['version'])?>"></script>

        </div>
        
                    </div>
</div>
<script type="text/javascript">
    try{
        if(parent){
            parent.window.PageCTL.MarkURL(window.location.href);
        }
    }catch(e){}
</script>
<div class="page-main">
    <div class="col-main" id="js_cantain_box">
        <div class="path-box" rel="page_local"></div>
        <div class="list-container" id="js_data_list_outer">
            <div style="min-height:100%;_height:100%;cursor:default" id="js_data_list">
        <?php if ($count > 0){ ?>
            <dl class="file-list" rel="list" id="js_data_list_inner">

                <dt>
                    <ul>
                        <li class="file-check">
                            <input type="checkbox" check="all">
                        </li>
                        <li class="file-name"><a href="javascript:;">文件名</a></li>
                        <li class="file-time"><a href="javascript:;">删除时间</a></li>
                        <li class="file-size"><a href="javascript:;">大小</a></li>

                    </ul>
                </dt>
                    <?php foreach ($list as $file) {?>
                    <?php if($file['file_type']==0){?>
                    <dd tid="<?php echo $file['id']?>" file_type="0" rel="item" index="0">
                        <ul>
	                        <li class="file-check"><input type="checkbox" pickcode="" filetype="1" filename="<?php echo $file['file_name']?>" value="<?php echo $file['id']?>"></li>
	                        <li class="file-name"><i class="file-type tp-<?php echo $file['ext']?>"></i><span class="name-con"><?php echo $file['file_name']?></span></li>
	                        <li class="file-time"><span><?php echo $file['updated_at']?></span></li>
	                        <li class="file-size"><i><?php echo $file['file_size']?></i></li>
                        </ul>
                    </dd>
                    <?php } else {?>
                    <dd tid="<?php echo $file['id']?>" file_type="1" rel="item" index="1">
                        <ul>
                            <li class="file-check"><input type="checkbox" pickcode="" filetype="0" filename="<?php echo $file['file_name']?>" value="<?php echo $file['id']?>"></li>
                            <li class="file-name"><i class="file-type tp-folder" rel="select"></i><span class="name-con"><?php echo $file['file_name']?></span></li>
                            <li class="file-time"><span><?php echo $file['updated_at']?></span></li>
                            <li class="file-size"><i></i></li>
                        </ul>
                    </dd>
                    <?php }}?>
                    
                    <?php }else{ ?>
                    <div class="no-file">
                    <div class="page-info">
	                    <h3><i class="i-hint ico-inf">
	                    </i>当前目录没有文件</h3>
	                    <p>真棒！您没有需要处理的垃圾文件</p>
	                    <p>您在 "回收站" 中可以查看您删除后的文件！</p>
                    </div></div>
                 <?php }?>

                
                   

                                            </dl>
            </div>
        </div>
                    <div class="pages"><div class="con">
        			<?php if ($pageSize > 1){ ?>
                    <?php if ($currentPage == 1){ ?>
                        <span class='btn btn-prev'>上一页</span>
                    <?php }else{?>
                        <a href='<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=list/index&ct=file&ac=userfile&limit=<?php echo $limit?>&tpl=list_pg&aid=<?php echo $aid?>&s=<?php echo ($currentPage-2)*$limit?>' class='btn btn-prev'>上一页</a>
                    <?php }?>
                     <?php   for ($i=1; $i <= $pageSize; $i++){
                            $css = "";
                            if ($i == $currentPage){
                                $css = "class='focus'";
                            }
                     ?>
                    <a href='<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=list/index&ct=file&ac=userfile&limit=<?php echo $limit?>&tpl=list_pg&aid=<?php echo $aid?>&s=<?php echo ($i-1)*$limit?>' <?php echo $css?>'><?php echo $i?></a> 
                    <?php } ?>
                    <?php if ($pageSize == $currentPage) {?>
                        <span class="btn btn-next">下一页</span>
                    <?php }else{ ?>
                        <a href='<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=list/index&ct=file&ac=userfile&limit=<?php echo $limit?>&tpl=list_pg&aid=<?php echo $aid?>&s=<?php echo ($currentPage)*$limit?>' class='btn btn-next'>下一页</a>
                    <?php }} ?>
					</div></div>
    </div>
    <div class="col-sub" id="js_right_side">
        <div class="file-info">
            <div class="file-thumb folder-recycle"></div>
            <div class="thumb-name">回收站</div>
            <ul id="js_rb_right_ul">
<!--                                <li><i class="fl">安全密码:</i>-->
<!--                    <span class="fr">-->
<!---->
<!--                        <i style="color:red;">未开启</i>-->
<!--                        <a href="javascript:;" onclick="SettingPassWord();return false;">设置</a>-->
<!--                    </span></li>-->
                            </ul>
        </div>
        <div class="sub-tips">
            <h3><i class="icon ico-tips"></i>小贴士</h3>

            <ul>
                <li>• 回收站文件将占用<?php echo(Yii::app()->params['app']['name'])?>空间 </li>
                <li>• 永久删除回收站内容将无法恢复 </li>
            </ul>
        </div>
    </div>

</div>
</body>
</html>
<script type="text/javascript">
	var IsTempLoad = true;
	var dataSource = {aid: 7, cid: 0};
	var NoRightSide = true;
	var interface = {
		GetHtml: function(arr){
			return "";
		}
	}
</script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/list.js"></script>
<script type="text/javascript">
//选中文件委托
FileCheckHandler = function(arr, eX, eY){
	TopMenu.CheckMenu(arr, eX, eY);
}
FileCheckHandler(false);
</script>

<script type="text/javascript">

if(parent && parent.window.Main.Core.FileAjax){
	     var SettingPassWord = function(){
        var f = document.createElement("form");
        f.action = "http://my.miniyun.com/?ct=security&ac=set_superpwd";
        f.method = "post";
        f.target = "_blank";
        $(document.body).append(f);
        f.submit();
        window.setTimeout(function(){
            $(f).empty().remove();

            parent.window.Main.Core.Message.Confirm({
                text:"请在弹出的新窗口中设置安全密码",
                content: "您在设置完毕前不要关闭本页面<br/>设置完毕后，永久删除文件需要输入安全密码，以防止重要文件误删<br/>回收站的文件保留15天，到期后将自动永久删除",
                type: "war",
                confirm_text: "立即使用回收站",
                cancel_text: "下次设置",
                callback: function(r){
                    if(r){
                        window.location.reload();
                    }
                }
            });
        },50);
     }
	 parent.window.Main.Core.FileAjax.RBPassWordSet = function(){
         parent.window.Main.Core.Message.Confirm({
             text: "您需要设置好安全密码后，才能使用此功能",
             content: "原回收站密码升级为安全密码，请您在个人中心重新设定<br/>回收站占用您的<?php echo(Yii::app()->params['app']['name'])?>空间，请及时清理<br/>回收站的文件保留15天，到期后将自动永久删除",
             type: "war",
             confirm_text: "立即设置安全密码",
             cancel_text: "暂不设置",
             callback: function(r){
                if(r){
                    SettingPassWord();
                }
             }
         })
	}
	}

(function(){
    $.ajax({
        url: "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=operate/index&ct=rb&ac=get_num",
        type: "GET",
        cache: false,
        dataType: "json",
        success: function(r){
            try{
                var count = r.count;
                if(count){
                    $("#js_rb_right_ul").append('<li><i class="fl">包含:</i><span class="fr">'+count+' 条记录</span></li>')
                }
            }catch(e){}
        }
    })
})()
</script>
